package android.streetview;
 
import mobilefeel.sdk.MobileFeelActivity;
import android.content.Context;
import android.os.Bundle;
import android.os.PowerManager;
import android.widget.Toast;

public class StreetViewActivity extends MobileFeelActivity {
	
	private PowerManager.WakeLock wakeLock;

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.streetview);
        
		this.registerView(R.id.mainView, "Street View");
    
		PowerManager powerManager= (PowerManager) getSystemService(Context.POWER_SERVICE);
        wakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "Tesis");
        wakeLock.acquire(); 
    }
	

	@Override
    protected void onResume() {
        super.onResume();
        wakeLock.acquire();
	}

	@Override
    protected void onPause() {
        super.onPause();
        wakeLock.release();
    }	

	@Override
	protected void onDestroy() {
		super.onDestroy(false);
		wakeLock.release();
	}

	@Override
	public void onBackPressed() {
		disconnect();
		super.onBackPressed();
	}
	
	@Override
	protected void onDisconnection(boolean remote) {
		Toast.makeText(this, "Desconectado", Toast.LENGTH_SHORT).show();
	}
}